'''
Created on May 28, 2012

@author: mupet
'''
from syslogd.gui.eventlisteners.GeneralEventListener import GeneralEventListener
from syslogd.gui.tabs.AlertsTab import AlertsTab
from syslogd.gui.tabs.BehaviourTab import BehaviourTab
from syslogd.gui.tabs.GeneralTab import GeneralTab
from syslogd.gui.tabs.RulesTab import RulesTab
from syslogd.gui.tabs.StatsTab import StatsTab
from syslogd.gui.tabs.ViewLogTab import ViewLogTab
import wx

class SysLogMainFrame(wx.Frame):
    
    pages = [GeneralTab, RulesTab, AlertsTab, BehaviourTab, ViewLogTab, StatsTab]
    
    generalEventListener = GeneralEventListener()
    
    def __init__(self, *args, **kwargs):
        wx.Frame.__init__(self, *args, **kwargs)
        self.SetMinSize(wx.Size(700, 300))
        self.create_controls()
        
    def create_controls(self):
        p = wx.Panel(self)
        nb = wx.Notebook(p);
        for pageInfo in self.pages:
            page = pageInfo(nb, self.generalEventListener)
            nb.AddPage(page, page.name)
        sizer = wx.BoxSizer()
        sizer.Add(nb, 1, wx.EXPAND)
        p.SetSizer(sizer)
